<div class="actions">
    <?php
    echo CHtml::link('Thêm thu chi mới', array('expense/create'), array('class' => 'btn btn-small btn-success'));
    ?>
    <?php
    echo CHtml::link(ProductModule::t('Xem tất cả'), array('expense/list'), array('class' => 'btn btn-small btn-success'));
    ?>
</div>
<?php if (Yii::app()->user->hasFlash('error')): ?>
    <div class="alert alert-error">  
        <a class="close" data-dismiss="alert">×</a>  
        <?php echo Yii::app()->user->getFlash('error') ?>
    </div>  
<?php endif ?>
<?php
$this->renderPartial('_searchForm', array('model' => $form));

$this->widget('bootstrap.widgets.TbGridView', array(
    'dataProvider' => $dataProvider,
    'type' => 'striped bordered condensed',
    'columns' => array(
        array('name' => 'expense_id', 'value' => '$data->expense_id', 'type' => 'number'),
        array('name' => 'amount', 'value' => '$data->getAmount()'),
        array('name' => 'date', 'value' => '$data->getDate()', 'type' => 'raw'),
        array('name' => 'reason', 'value' => '!empty($data->reason)?$data->reason:"--"'),
        array(// display a column with "view", "update" and "delete" buttons
            'class' => 'CButtonColumn',
            'template' => '{update}{delete}',
        ),
    ),
));
?>
<script>
    jQuery(document).ready(function($){
        $("#SearchDateRangeForm_begin_date").datepicker();
        $("#SearchDateRangeForm_end_date").datepicker();
    });
</script>